<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
<title>6.863 Project: Policy Parser</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

	<!-- Begin Wrapper -->
	
		<div id="wrapper">
		
		<!-- Begin Header -->
			
			<div id="header">
				<h1>Policy Parser</h1>
				<h2>6.863 Spring 2008 Project</h2>		 
			</div>
			
		<!-- End Header -->
			
		<!-- Begin Strap -->
		
        <div id="strap">
<b>Policy Parser</b> &raquo; Download Code</div>
		
		<!-- End Strap -->
		 
		<!-- Begin Navigation -->
		
		<div id="navigation">
			<ul id="menu">
				<li><a href="index.html">Home</a></li>
				<li><a href="intro.html">Intro</a></li>
			    <li><a href="try.html">Try It Now!</a></li>
	            <li><a href="implementation.html">Implementation</a></li>
                <li><a href="results.html">Results</a></li>
	            <li><a href="future.html">Future Directions</a></li>
	            <li><a href="#">Download Code</a></li>
 			 	<li><a href="members.html">Members</a></li>
			</ul>
		</div>
		
		<!-- End Navigation -->
		 
		<!-- Begin Content-->

		<div id="content">
		    <h2>Downloading the Policy Parser</h2>
			<br />
			<p> <a href="data/PolicyParser.tar.gz">Click here</a> to download the complete code for 
              the Policy Parser.  
            </p><br />
            <p>
            The directory structure of the code (after expanding the
            .tar.gz file) is as follows:
            </p><br />
            <p>
            <ul id="panel">
              <li>data/: contains the FCFG grammar file (.fcfg), the lexicon (.lex), the spelling change rules (.yaml), and the RDF ontology file (.n3).
              <li>featureparse/: the Feature Parsing Library, written by Rob Speer and provided on the 6.863 website.
              <li>PolicyInterpreter/: Contains the complete Python
              code for the Policy Interpreter. The
              file <tt>policyParser.py</tt> contains the main
              function for running our system on the command line,
                and <tt>policyInterpreter.py</tt> contains the
                algorithms for policy interpretation.
              <li>RDFGenerator/: Contains the complete Python code for
              the RDF Generator. The file <tt>generate.py</tt>
              contains the algorithms for generating the RDF from a policy.
           </ul>
              </p><br />
              <p>
              <b>Executing the Policy Parser on the command line:</b>
              </p><br />
                <p>
                  Even though the Policy Parser is available on the web for use, the user may wish you execute it on their own machine. The instructions for running the Policy Parser on the command line is as follows:
               </p><br />
                <p>
                  NOTE: The user must have the NLTK library already installed on the machine, and the path to the library should be added to the environment variable PYTHONPATH.
                </p><br />
                <p>
                  Untar PolicyParser.tar.gz into a directory of choice. In
                  that directory, type:</p><br />
            <p>
                <tt>  
              bash$: cd PolicyInterpreter <br />
              bash$: python <br />
              Python 2.5.1 (r251:54863, Feb 4 2008, 21:48:13) <br />
              [GCC 4.0.1 (Apple Inc. build 5465)] on darwin <br />
              Type "help", "copyright", "credits" or "license" for
              more information. <br />
              >>> from policyParser import * <br />
              >>> result = runPolicyParser() <br />
           </tt>
            </p><br />
            <p>
            The Policy Parser asks the user for two inputs: the name
            of a policy and the sentence for the policy itself. 
            The result of running the Policy Parser is a string that
            represent the generated RDF. To use the AIR reasoner with
            this policy, however, the RDF file must be stored at a
            location (URI) on the web. Thus, we recommend the user to
            use <a href="try.html">our web tool</a>, 
            which automatically stores the
            generated RDF on the web and provides an interface to
            retrieve the RDF for the use with the reasoner.
           </p>
	    </div>
		
		<!-- End Content -->
		
		<!-- Start Footer -->
		
		<div id="footer">
		</div>
		
		<!-- End Footer -->
		 
    </div>
	
    <!-- End Wrapper -->
	
</body>
</html>
